package com.hqq.topic;

import com.hqq.queue.service.QueueProducer;
import com.hqq.topic.service.TopicProducer;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ProducerMain
 * Created by heqianqian on 2018/1/20.
 */
public class ProducerMain {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("topic/producer.xml");
        TopicProducer topicProducer= (TopicProducer) context.getBean("topicProducer");
        for (int i = 0; i < 100; i++) {
            topicProducer.sendMessage("Topic-Message" + i);
        }
        context.close();
    }
}
